#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int a;

int foo(void)
{
    int i;
    printf("%d\n", i);
    i = 777;
    return 0;
}

void GetMemory(char *p, int num)
{
    p = (char *)malloc(sizeof(char) * num);
}

struct bit_data 
{
    char a:8;
    short b:8;
    int c:17;
};
struct bit_data1 
{
    char a:2;
    char b:3;
    char c:5;
};

int arr[][4] = {{1,2,3,4},{3,4,5,6},{5,6,7,8},{7,8,9,0}};

int main(int argc, char const *argv[])
{
    printf ("%d %d %d \n", *(*(arr+1)+2), **(&arr[0]+1), arr[2][2]);
    foo();
    //sleep (2);
    //int x = 123;
    //printf ("%d\n", x);
    printf ("Hello!1\n");
    int j;
    for (j = 0; j < 100; j++)
    {
        int c = 9;
    }
    foo();
    printf ("Hello!123\n");
    char* a = "Hello!123\n";
    printf ("%d\n",(int) sizeof (arr));
    foo();
    foo();
    char c = 'a';
    const char * s = "nihao";
    const char* pc = &c;
    printf ("%c \n", *pc);
    printf ("%c \n", s[2]);
    char str[] = "nihaonihao";
    //char * str1 = "nihaonihao";
    int x = 10;
    char * p = str;
    printf ("\n\n%lu \n\n", sizeof(struct bit_data1));
    printf ("%lu \n", sizeof(str));
    //printf ("%lu \n", sizeof(str1));
    printf ("%lu \n", sizeof(x));
    printf ("%lu \n", sizeof(p));
    char * ssss = NULL;
    GetMemory (ssss, 100);
    strcpy (ssss, str);
    free (ssss);

    return 5;
}
